import Vue from 'vue'
import Router from 'vue-router'
import bottom from '@/pages/bottom'
import drive from '@/pages/drive'
import share from '@/pages/share'
import more from '@/pages/more'
import category from '@/pages/category'
import transfer from '@/pages/transfer'
import search from '@/pages/search'
import login from '@/pages/login'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    component: bottom, // 主页底部的导航按钮
    children: [{
      path: '',
      redirect: '/drive' // 登录后进入默认页面
    }, {
      path: '/drive',
      component: drive // 主页
    }, {
      path: '/share',
      component: share // 分享
    }, {
      path: '/more',
      component: more // 更多
    }],
  }, {
    path: '/category/:title',
    component: category
  }, {
    path: '/transfer',
    component: transfer
  }, {
    path: '/search',
    component: search
  }, {
    path: '/login',
    component: login
  }]
})

// {
//   path: '/somepath',
  // component: function (resolve) {
  //   require(['./demos/somepath.vue'], resolve)
  // }
// }
